package modeller.databasedesignmodel.query;

import modeller.databasedesignmodel.Attribute;
import modeller.databasedesignmodel.relation.Relation;
import modeller.databasedesignmodel.servicedemand.transaction.sqlquery.demandFetcher.ISQLQueryServiceDemandCalculator;
import modeller.databasedesignmodel.servicedemand.IServiceDemand;
import modeller.databasedesignmodel.transaction.SQLQuery;
import queped.SerializablePair;

import java.util.HashSet;

/**
 * Created by IntelliJ IDEA.
 * User: Jason Ye
 * Date: 05/02/2012
 * Time: 12:18

 */
public class EqualityWithRangeSearchQuery extends SQLQuery {

    private int m_numMatchingRows;

    public EqualityWithRangeSearchQuery(SerializablePair<Relation, HashSet<Attribute>> relationList) {
        super(relationList);
    }

    @Override
    public String myToString() {
        return "\nEQUALITY WITH RANGE SEARCH Query which accesses relations in the following order: " + getPrintedAttributeList();
    }

    @Override
    public IServiceDemand acceptCalculation(ISQLQueryServiceDemandCalculator visitor) {
        return visitor.calculate(this);
    }

    public int getNumMatchingRows() {

        return m_numMatchingRows;
    }
    public void setNumMatchingRows(int m_numMatchingRows) {
        this.m_numMatchingRows = m_numMatchingRows;
    }

}
